package com.zeroone.star.systemhome.controller.file;

import com.zeroone.star.project.dto.systemhome.FileDTO;
import com.zeroone.star.project.systemhome.FileApis;
import com.zeroone.star.project.vo.JsonVO;
import com.zeroone.star.project.vo.systemhome.FileStatisticsVO;
import com.zeroone.star.systemhome.service.file.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsProject: oa-java
 * @BelongsPackage: com.zeroone.star.systemhome.controller.file
 * @Author: dashuai
 * @CreateTime: 2024-11-18  15:07
 * @Description: 文件controller
 * @Version: 1.0
 */
@RestController
@RequestMapping("/file")
@Api(tags = "文件管理")
public class FileController implements FileApis {
    @Resource
    private FileService fileService;

    @ApiOperation("查询我的文件列表")
    @GetMapping("query-my-file")
    @Override
    public JsonVO<List<FileDTO>> queryMyFileList(String id) {
        return JsonVO.success(fileService.listMyFile(id));
    }

    @ApiOperation("统计文件信息")
    @GetMapping("count-file")
    @Override
    public JsonVO<FileStatisticsVO> countFileStatistics(String id) {
        return JsonVO.success(fileService.countFile(id));
    }
}
